from sqlalchemy import create_engine

db_string = "postgresql://postgres:postgresql@localhost:5432/crowdsourcingDB"
# app.config['SQLALCHEMY_DATABASE_URI'] = "postgresql://postgres:postgresql@localhost:5432/crowdsourcingDB"

db = create_engine(db_string)

# Create
# db.execute("CREATE TABLE IF NOT EXISTS films (title text, director text, year text)")
# db.execute("INSERT INTO films (title, director, year) VALUES ('Doctor Strange', 'Scott Derrickson', '2016')")

# Read
result_set = db.execute("select * from task")
for r in result_set:
    print(r)
    break

# Update
# db.execute("UPDATE films SET title='Some2016Film' WHERE year='2016'")

# Delete
# db.execute("DELETE FROM films WHERE year='2016'")
